package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.NonNull;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message = "用户名不能为null和空字符串")
    //@NotBlank(message = "用户名不能为null和空字符串和空白串")
//    @Size(min = 3, max = 10, message = "用户名长度必须在3-10之间")
    @Pattern(regexp = "^[a-zA-Z0-9_\\u4e00-\\u9fa5]{0,7}$|^[a-zA-Z0-9_]{0,14}$",
            message = "用户名最长为14个英文或7个汉字")
    @Schema(description = "用户名", required = true, example = "admin")
    private String username;
    @Pattern(regexp = "^(?![\\d]+$)(?![a-zA-Z]+$)(?![^a-zA-Z\\d]+$)[^\\s\\u4e00-\\u9fa5]{8,14}$",
            message = "密码不合法")
    @Schema(description = "密码", required = true, example = "123456")
    private String password;

    //@Email(message = "邮箱格式错误")
    @Pattern(regexp = "^[a-zA-Z0-9_.-\\u4e00-\\u9fa5]+@[a-zA-Z0-9-\\u4e00-\\u9fa5]+(\\.[a-zA-Z0-9-\\u4e00-\\u9fa5]+)*\\.[a-zA-Z]{2,}(\\.[a-zA-Z]{2,})?$",
            message = "邮箱不合法")
    @Schema(description = "邮箱", required = true, example = "admin@163.com")
    private String email;
    @Schema(description = "手机号码", required = true, example = "13888888888")
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$|^0\\d{2,3}-?\\d{7,8}$|^\\(0\\d{2,3}\\)-?\\d{7,8}$",
            message = "电话不合而法")
    private String phone;
}
